var formDate={
  YMD:function (time) {
    var myDate = new Date(time);
    var year=myDate.getFullYear();    //获取完整的年份4位
    var month=myDate.getMonth()+1;//获取当前月份(0-11,0代表1月)
    var day=myDate.getDate(); //获取当前日(1-31)
    if(month<10){
      month='0'+month
    }
    if(day<10){
      day='0'+day
    }
    return (year+'.'+month+'.'+day)
  },
  YMD2:function (time) {
    var myDate = new Date(time);
    var year=myDate.getFullYear();    //获取完整的年份4位
    var month=myDate.getMonth()+1;//获取当前月份(0-11,0代表1月)
    var day=myDate.getDate(); //获取当前日(1-31)
    if(month<10){
      month='0'+month
    }
    if(day<10){
      day='0'+day
    }
    return (year+'.'+month+'.'+day)
  },
  TMDHS:function (time) {
    var myDate = new Date(time);
    var year=myDate.getFullYear();    //获取完整的年份4位
    var month=myDate.getMonth()+1;//获取当前月份(0-11,0代表1月)
    var day=myDate.getDate(); //获取当前日(1-31)
    var hours=myDate.getHours();
    var minutes=myDate.getMinutes();
    var seconds=myDate.getSeconds();
    if(month<10){
      month='0'+month
    }
    if(day<10){
      day='0'+day
    }
    if(hours<10){
      hours='0'+hours
    }
    if(minutes<10){
      minutes='0'+minutes
    }
    if(seconds<10){
      seconds='0'+seconds
    }
    return (year+':'+month+':'+day+' '+hours+':'+minutes+':'+seconds)

  },
  timeStampForm:function (time) {
    var date=new Date(time)
    return Date.parse(date);
  }
}




export {formDate};
